<%--
  @author Duminda Dharmakeerthi
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<script type="text/javascript">
    var fieldIds_institute = new Array(
            'departmentNameId',
            'departmentAddressId',
            'departmentMobileId',
            'departmentLandPhoneId',
            'departmentEmailId',
            'departmentFaxlId',
            'contactPersonId',
            'designationId',
            'personMobileId',
            'personLandPhoneId',
            'personEmailId',
            'personFaxId',
            'communicationMethodDep',
            'communicationLanguageDep'
            );

    $(function() {
        var mode = document.getElementById("edit_mode").value;
       // if (mode == 2 || mode == 3 || mode == 9 || mode == 20 || mode == 21 || mode == 30) {
        if (mode == 2){
            /* var fieldIds = new Array(
             'departmentNameId',
             'departmentAddressId',
             'departmentMobileId',
             'departmentLandPhoneId',
             'departmentEmailId',
             'departmentFaxlId',
             'contactPersonId',
             'designationId',
             'personMobileId',
             'personLandPhoneId',
             'personEmailId',
             'personFaxId'
             );*/
            disableFields(fieldIds_institute);
        }
    });
</script>

<tr>
    <td><s:label value="%{getText('name_of_the_Department.label')}" cssClass="mandatory-field"/>
    </td>
    <td colspan="3"><s:textarea name="holder.name" cssClass="width-500-px"
                                id="departmentNameId"/>
    </td>
</tr>
<tr>
    <td><s:label value="%{getText('address_of_the_department.label')}" cssClass="mandatory-field"/>
    </td>
    <td colspan="3"><s:textarea cssClass="width-500-px" name="contacts.address"
                                id="departmentAddressId"/></td>
</tr>
<tr>
    <td><s:label value="%{getText('telephone.label')}"/></td>
    <td><s:label value="%{getText('mobile.label')}"/></td>
    <td colspan="2"><s:textfield name="contacts.mobile" id="departmentMobileId"/></td>
</tr>
<tr>
    <td></td>
    <td><s:label value="%{getText('land_phone.label')}"/></td>
    <td colspan="2"><s:textfield name="contacts.landPhone" id="departmentLandPhoneId"/>
    </td>
</tr>
<tr>
    <td><s:label value="%{getText('email.label')}"/></td>
    <td><s:textfield name="contacts.email" id="departmentEmailId"/></td>
    <td><s:label value="%{getText('fax.label')}"/></td>
    <td><s:textfield name="contacts.fax" id="departmentFaxlId"/></td>
</tr>
<tr>
    <td><s:label value="%{getText('communication_method.label')}"/></td>
    <td><s:select list="communicationMethodAsList"
                  name="landApplication.communicationMethod" id="communicationMethodDep" cssClass="width-180-px"

                  listValue="%{getText(toString())}"
                 />

    </td>
    <td><s:label value="%{getText('communication_language.label')}"/></td>
    <td><s:select
            list="#@java.util.HashMap@{'ta':getText('tamil.label'),'si':getText('sinhala.label'),'en':getText('english.label')}"
            name="landApplication.communicationLanguage" id="communicationLanguageDep" cssClass="width-180-px"
            headerKey="0"
            headerValue="%{getText('select.label')}"/>

    </td>
</tr>
<tr>
    <td colspan="4" align="center">
        <hr/>
        <s:label cssStyle="font-weight: bold;" value="%{getText('details_of_contact_person.label')}"/>
    </td>
</tr>
<tr>
    <td><s:label value="%{getText('name.label')}" cssClass="mandatory-field"/></td>
    <td colspan="3">
        <s:textarea name="contactPerson.name" cssClass="width-500-px" id="contactPersonId"/>
    </td>
</tr>
<tr>
    <td><s:label value="%{getText('designation.label')}"/></td>
    <td colspan="3"><s:textarea name="holder.designation" cssClass="width-500-px"
                                id="designationId"/></td>
</tr>
<tr>
    <td><s:label value="%{getText('telephone.label')}"/></td>
    <td><s:label value="%{getText('mobile.label')}"/></td>
    <td colspan="2"><s:textfield name="contactPerson.mobile" id="personMobileId"/>
    </td>
</tr>
<tr>
    <td></td>
    <td><s:label value="%{getText('land_phone.label')}"/></td>
    <td colspan="2"><s:textfield name="contactPerson.landPhone" id="personLandPhoneId"/></td>
</tr>
<tr>
    <td><s:label value="%{getText('email.label')}"/></td>
    <td><s:textfield name="contactPerson.email" id="personEmailId"/></td>
    <td><s:label value="%{getText('fax.label')}"/></td>
    <td><s:textfield name="contactPerson.fax" id="personFaxId"/></td>
</tr>


